#ifdef MEM_DEBUG

#ifndef ALLOCATION_MANAGER_H
#define ALLOCATION_MANAGER_H

#include <map>
#include "Singleton.h"
#include "Allocation.h"

namespace Engine
{
	class AllocationManager : public NonCopyable
	{
		private:
			friend class Singleton <AllocationManager>;
			AllocationManager();
			typedef std::map <void*, Allocation> AllocationMap;
			AllocationMap m_map;
			size_t m_sizeOfAllocs;
			size_t m_maxSizeOfAllocs;
			size_t m_maxHeapSize;

		public:
			void SetMaxHeapSize(size_t size){m_maxHeapSize = size;}
			size_t GetTotalSizeOfAllocs() const{return m_sizeOfAllocs;}
			size_t GetMaxSizeOfAllocs() const{return m_maxSizeOfAllocs;}
			void AddAllocation(const Allocation& a);
			void RemoveAllocation(void* address);
			void Report(const std::string& s = "leakReport.txt");
			~AllocationManager();
	};

	typedef Singleton <AllocationManager> TheAllocationManager;
}

#endif//include guards

#endif//ifdef MEM_DEBUG